import {myRequest} from "../utils/request.js"

//首页商品列表
export function indexShopGoods(data) {
	return myRequest({
		url: "shop_goods/goodsListPage",
		method: "post",
		data: data
	})
}

//商品列表
export function shopGoods(data) {
	return myRequest({
		url: "shop_goods/goodsList",
		method: "post",
		data: data
	})
}

//商品详情
export function goodsInfo(data) {
	return myRequest({
		url: "shop_goods/goodsInfo",
		method: "post",
		data: data || {}
	})
}
//下单详情
export function createOrderDetails(data) {
	return myRequest({
		url: "shop_order/createOrderDetails",
		method: "post",
		data: data
	})
}

//创建订单支付
export function createOrder(data) {
	return myRequest({
		url: "shop_order/createOrder",
		method: "post",
		data: data
	})
}

//填写收货地址
export function saveAddress(data) {
	return myRequest({
		url: "shop_order/saveAddress",
		method: "post",
		data: data
	})
}
//删除收货地址
export function addressDelete(data) {
	return myRequest({
		url: "shop_order/addressDelete",
		method: "post",
		data: data
	})
}
//收货地址默认修改
export function addressDefault(data) {
	return myRequest({
		url: "shop_order/addressDefault",
		method: "post",
		data: data
	})
}
//收货地址列表
export function addressList(data) {
	return myRequest({
		url: "shop_order/addressList",
		method: "post",
		data: data
	})
}

//获取省市区
export function getArea(data) {
	return myRequest({
		url: "common_api/getArea",
		method: "post",
		data: data
	})
}
//宝箱首页汇总
export function blindboxSummary(data) {
	return myRequest({
		url: "blind_box_orders/blindboxSummary",
		method: "post",
		data:data||{}
	})
}

//商城配置文案
export function shopGoodsConfig(data) {
	return myRequest({
		url: "agreement/shopGoodsConfig",
		method: "post",
		data: data
	})
}
//订单支付检测
export function orderCheck(data) {
	return myRequest({
		url: "shop_order/orderCheck",
		method: "post",
		data: data
	})
}
//订单支付检测
export function orderCheck2(data) {
	return myRequest({
		url: "currency_rent_order/orderCheck",
		method: "post",
		data: data
	})
}
// --------------------------------------------------------------

export function winningrecord(data) {
	return myRequest({
		url: 'blind_box_orders/winningrecord',
		method: "POST",
		data:data||{}
	})
}
export function openBlindbox(data) {
	return myRequest({
		url: 'blind_box_orders/openBlindbox',
		method: "POST",
		data:data||{}
	})
}
export function publicity(data) {
	return myRequest({
		url: 'blind_box_orders/publicity',
		method: "POST",
		data:data||{}
	})
}
export function openRecord(data) {
	return myRequest({
		url: 'blind_box_orders/openRecord',
		method: "POST",
		data:data||{}
	})
}
export function orderList(data) {
	return myRequest({
		url: 'shop_order/orderList',
		method: "POST",
		data:data||{}
	})
}
export function orderCancel(data) {
	return myRequest({
		url: 'shop_order/orderCancel',
		method: "POST",
		data:data||{}
	})
}
export function orderDetails(data) {
	return myRequest({
		url: 'shop_order/orderDetails',
		method: "POST",
		data:data||{}
	})
}
export function orderConfirm(data) {
	return myRequest({
		url: 'shop_order/orderConfirm',
		method: "POST",
		data:data||{}
	})
}
export function config(data) {
	return myRequest({
		url: 'blind_box_orders/config',
		method: "POST",
		data:data||{}
	})
}
export function give(data) {
	return myRequest({
		url: 'blind_box_orders/memberGive',
		method: "POST",
		data:data||{}
	})
}

